//
//  HMShopViewController.m
//  G05爱鲜蜂
//
//  Created by 曹魏 on 16/10/20.
//  Copyright © 2016年 何源. All rights reserved.
//

#import "HMTableFootView.h"
#import "Masonry.h"
#import "PayTableViewController.h"

@interface HMTableFootView ()

@end

@implementation HMTableFootView

- (instancetype)init{
    if (self = [super init]) {
        self.backgroundColor = [UIColor whiteColor];
        _money = [[UILabel alloc]init];
        _money.font = [UIFont systemFontOfSize:15];
        _money.textColor = [UIColor redColor];
        _money.text = @"共$ 10";
        [self addSubview:_money];
        
        
                
        _commitBtn = [[UIButton alloc]init];
        [_commitBtn setTitle:@"选好了" forState:UIControlStateNormal];
        [_commitBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [_commitBtn addTarget:self action:@selector(commitBtnClick) forControlEvents:UIControlEventTouchUpInside];
        _commitBtn.backgroundColor = [UIColor colorWithRed:0.992 green:0.831 blue:0.192 alpha:1.000]
;
        [self addSubview:_commitBtn];
        
        [_money mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.width.equalTo(@250);
            make.leading.equalTo(self).offset(15);
            make.height.equalTo(@15);
        }];
        [_commitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.trailing.equalTo(self);
            make.height.equalTo(self);
            make.width.equalTo(@100);
        }];
    }
    return self;
}

-(void)commitBtnClick {
    
    if (_commitBlock) {
        _commitBlock();
    }
}
@end












